<template>
<div>
  <el-table
      size="small"
      :data="emps"
      stripe
      style="width: 100%">
    <el-table-column
        type="selection"
        width="55">
    </el-table-column>
    <el-table-column
        prop="name"
        label="姓名"
        width="70">
    </el-table-column>
    <el-table-column
        prop="workID"
        label="工号"
        width="80">
    </el-table-column>
    <el-table-column
        prop="email"
        label="邮箱"
        width="170">
    </el-table-column>
    <el-table-column
        prop="phone"
        label="电话号码"
        width="110">
    </el-table-column>
    <el-table-column
        prop="department.name"
        label="所属部门"
        width="110">
    </el-table-column>
    <el-table-column
        label="工资账套"
        width="120">
      <template slot-scope="scope">
        <el-tag v-if="scope.row.s">{{scope.row.s.name}}</el-tag>
        <el-tag v-else>暂未设置</el-tag>
      </template>
    </el-table-column>
    <el-table-column
        label="操作"
        width="120">
      <template slot-scope="scope">
        <el-button type="danger" size="small">修改工资账套</el-button>
      </template>
    </el-table-column>
  </el-table>
  <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[10, 20, 30, 40]"
      :page-size="size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
  </el-pagination>
</div>
</template>

<script>
export default {
name: "SalSobCfg",
  data(){
  return{
    emps:[],
    currentPage:1,
    size:10,
    total:0
  }
  },
  methods:{
    handleSizeChange(size){
      this.size = size
      this.initEmps()
    },
    handleCurrentChange(page){
      this.currentPage = page
      this.initEmps()
    },
    initEmps(){
    this.getRequest('/employee/basic/list?currentPage='+this.currentPage + '&size=' + this.size).then(res=>{
      if (res){
        debugger
        this.emps = res.date
        this.total = res.total
      }
    })
  }
  },
  mounted() {
  this.initEmps()
  }
}
</script>

<style scoped></style>